package com.four.seckill.mq;


import com.four.seckill.vo.SeckillVo3;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Purducre {

    @Autowired
    private RabbitTemplate rabbitTemplate;
    /**
     *
     * @param seid 秒杀商品主键
     * @param userName 用户id
     */
    public void userseckillgoods(Integer seid, String userName) {
        SeckillVo3 seckillVo3 = new SeckillVo3();
        seckillVo3.setSeId(seid);
        seckillVo3.setUserName(userName);

        rabbitTemplate.convertAndSend("shop",seckillVo3);
    }

}
